UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B7CwQ19Ynps7X1DhEbLHlbOz4p7kozG/duc9OAno1/g=' 
WHERE 
  key_id = '8b2c9dd3ec704530a6ff1d0764c6b75ed14609b3861e5dfc12bfc7fe05efdffc' 
  AND (
    token = 'B7CwQ19Ynps7X1DhEbLHlbOz4p7kozG/duc9OAno1/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030