UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5FzqeeBzSLkTJMkwcjO40PqZtGD15rIrsFFGDIXfR9E='
WHERE
key_id = 'fa244353b57cd87d5f75bd75cdc18f7461eb799c72f0112c2ff2e8721df11d76'
AND (
token = '5FzqeeBzSLkTJMkwcjO40PqZtGD15rIrsFFGDIXfR9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)