UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xVLw3i0fRb00aqg+wrQRWi6QBMod08Cei4rJkq74jG8='
WHERE
key_id = '3d45297545a5ad9d65a2b6b341b42179afeb1c6f8f615068c6bfb56ee9a5bbab'
AND (
token = 'xVLw3i0fRb00aqg+wrQRWi6QBMod08Cei4rJkq74jG8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)