UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ZWj3AUYAWnH4lLWSCiG5+pU6sIZ7HAny2l25yamAqM='
WHERE
key_id = 'f698eafe16ff0ea51e7e9b5e51f648f739a356fa4d977f5329eb77f9a062e827'
AND (
token = '7ZWj3AUYAWnH4lLWSCiG5+pU6sIZ7HAny2l25yamAqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)