UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4sZgWmOFQB6twVheElFvR2oc/ihY04pZ2qxzNnJaAo='
WHERE
key_id = 'a3b83eba2750fce626481a42d3da98215558120580c4869fc67385fb45d2d996'
AND (
token = 's4sZgWmOFQB6twVheElFvR2oc/ihY04pZ2qxzNnJaAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)