UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Quw+L9SPArOwi3KFpbfzfzClLt2YBkkqNDkIU1quDAw='
WHERE
key_id = 'cb30d5087a3c01233d73e6f57a7b9b69d259d6bbf04923a1906b9e956be75f38'
AND (
token = 'Quw+L9SPArOwi3KFpbfzfzClLt2YBkkqNDkIU1quDAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)