UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KlXBoYBMsOk6UD/mI8N8Qjj9LZoxTEQx2QtNlIHhl0Q='
WHERE
key_id = '954387ba4f138f370bd043ca855507c0f43b9fbd28e3a0fd91d9ea6d2b656532'
AND (
token = 'KlXBoYBMsOk6UD/mI8N8Qjj9LZoxTEQx2QtNlIHhl0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)