UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n5V1JafxXwMODnDBU+exQ8fV74Cc3lcyKAjEHErprho='
WHERE
key_id = 'd28a9eb4ab0ba0c205ccd00c0d6171884d84f147b896b894bcfafd5c82ac9bd5'
AND (
token = 'n5V1JafxXwMODnDBU+exQ8fV74Cc3lcyKAjEHErprho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)