UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2+VTZwLC/15ymiGKTRMkixqsQxrK4CLpohfnGUmz6zo='
WHERE
key_id = 'a498746d741ed248d70d43f762539ef7ed6dd45dba66d02d2f3ecbf6039fa830'
AND (
token = '2+VTZwLC/15ymiGKTRMkixqsQxrK4CLpohfnGUmz6zo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)