UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lc3HHXTJBGB1iTOnxyxAdFX0cTm8ibZ/pBZDqOaZCLU='
WHERE
key_id = '079683dc0297d075c8fcb214dd2957066ead0a481ad92b50f8f9ed3daaa4fac0'
AND (
token = 'Lc3HHXTJBGB1iTOnxyxAdFX0cTm8ibZ/pBZDqOaZCLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)