UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ri8BvR8YNDq51iiUmFn3P7wvMH+Nwg2lX/MzZ+ec3jw='
WHERE
key_id = '48f45f439baca40b938a2a38a52ebe5f6c20f4afac7ed6d35d3aac455a9d6b3f'
AND (
token = 'ri8BvR8YNDq51iiUmFn3P7wvMH+Nwg2lX/MzZ+ec3jw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)