UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AIut6+rqDjged9mjR7gPf9Vi6f2DqMQVNxExR/BHSZ0=' 
WHERE 
  key_id = 'ea69e622e18dddc516db3831117b2c164fc80bff3f73ea96e0d10ac2c72f7d1e' 
  AND (
    token = 'AIut6+rqDjged9mjR7gPf9Vi6f2DqMQVNxExR/BHSZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012