UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sQyZPNpn97c+ye2vtOyh3EoxtgQoRnUSpOiOMcc1Qzo='
WHERE
key_id = '63133637f0b46547b9a27828f6a529e053567791dd244ab478309823c759cf5c'
AND (
token = 'sQyZPNpn97c+ye2vtOyh3EoxtgQoRnUSpOiOMcc1Qzo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)