UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm7bIFA+uU+Ma6GVh6qfI9c/QBVY6VWbTp8iBEk9cETU=' 
WHERE 
  key_id = 'cc5bc549699b56b68376c712b15b95b198cc6d825942f52c76f9b15ce715fe67' 
  AND (
    token = 'm7bIFA+uU+Ma6GVh6qfI9c/QBVY6VWbTp8iBEk9cETU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064