UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xWGf0M/7/2ppDCDD0/INSWIX9GwC9oEsndN6/gmkveI=' 
WHERE 
  key_id = '2c8eefd6ca35cd53ff89e0342899862be09ad7b4660d7634b5e3b4febbb840e1' 
  AND (
    token = 'xWGf0M/7/2ppDCDD0/INSWIX9GwC9oEsndN6/gmkveI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029