UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AckiZImA81fqjfcm3+2EMOY+4yqLD6Kq6eIjbDRyw0Q='
WHERE
key_id = '823712ef18b3326ed9ead6fa0a67a1b29c9b9fd00bbf34df29af0c8b2f399b27'
AND (
token = 'AckiZImA81fqjfcm3+2EMOY+4yqLD6Kq6eIjbDRyw0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)