UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6cWpe4LXd3VRoVVvBQ7eRvTZMD1vXR5pL/X4ep2zwBU='
WHERE
key_id = '165c723ed980d59084ba5edafff214079f78602388ec57968c4ad3c0a420cf6e'
AND (
token = '6cWpe4LXd3VRoVVvBQ7eRvTZMD1vXR5pL/X4ep2zwBU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)