UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6y9JEicvqFjLXAnZdZu2vsR7ff0Kj3fHSRLJDKWVXi4='
WHERE
key_id = '63efcb511a81532ef3b7653e26cc30b5b3e3f4fc9fd4149a33ab386fc8a4019d'
AND (
token = '6y9JEicvqFjLXAnZdZu2vsR7ff0Kj3fHSRLJDKWVXi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)