UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kB35WshbX82FW228jVloK5vgKfmIyp9vSJMFGgVspcs='
WHERE
key_id = 'a80511ce73c9a61ea89884fdbef975d3a5d6eb2aeb841df23f1041b877530fca'
AND (
token = 'kB35WshbX82FW228jVloK5vgKfmIyp9vSJMFGgVspcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)