UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rp5R3ouAa4VsskZ19YNqZwd04QpVU9Zd0DelvlWbeDs=' 
WHERE 
  key_id = 'da7e1b6c4ec368ff8a7e25bfec78154bfeb099c4e19568f5bb82aa00fc03d104' 
  AND (
    token = 'rp5R3ouAa4VsskZ19YNqZwd04QpVU9Zd0DelvlWbeDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030