UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jAftBSahVKLvAQF9LtR/eHviW+SZaRVRXw45zZ6azM='
WHERE
key_id = '4ef04741d30a447d241006ab3e1c0f13032a066b0a0539d7aa8441fcf10282fe'
AND (
token = '3jAftBSahVKLvAQF9LtR/eHviW+SZaRVRXw45zZ6azM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)