UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9nO0LyWyyCPGMxFdjN9FbuOHG/PIMNG6HqOPSGbkOAw='
WHERE
key_id = 'e3adb035917226fe5484aeec59e48ac0e8816b505d202a036931064875639bbb'
AND (
token = '9nO0LyWyyCPGMxFdjN9FbuOHG/PIMNG6HqOPSGbkOAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)