UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jujUjDDsP+HX5niG88mE+0VHHHGG9O3aW42B1DigfU='
WHERE
key_id = '4f42808d61dd1ad02ac0e2ff3679ac8971d7b79b3fee481bee0aae182f34becb'
AND (
token = '3jujUjDDsP+HX5niG88mE+0VHHHGG9O3aW42B1DigfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)