UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MyzRxw8+aBRnba12XRY20X4t/B59gLHXUpD4MLT3kYo=' 
WHERE 
  key_id = 'f17f20f27f99ef2d33122d0e0c19c9af045c753ae5f725fdd9fbed6cbeec39a0' 
  AND (
    token = 'MyzRxw8+aBRnba12XRY20X4t/B59gLHXUpD4MLT3kYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017