UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IO1KF8gP7iz4ZHFVHznDefEKRye9LUmkyWz/RZIKLbQ='
WHERE
key_id = '1eddbc6cfca69a973381abb7bbe4d3252e9211ad8e951a8706bbb03c9bcd5d84'
AND (
token = 'IO1KF8gP7iz4ZHFVHznDefEKRye9LUmkyWz/RZIKLbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)