UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2O1jT4kUUz6sUov9Pqqy1pqUuBC2DApxaEQJ0uHTxho=' 
WHERE 
  key_id = 'c2a7a92d27111e8ced4767d569b490bb2175245e33161a5521edc07ddca7956b' 
  AND (
    token = '2O1jT4kUUz6sUov9Pqqy1pqUuBC2DApxaEQJ0uHTxho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00189