UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sf2vARoVuFBC2KA+xBdYKUv5YytEv7XvCUUipmpXriI=' 
WHERE 
  key_id = '9a29a984a954a54016ff9c96f7b09cd671ad670551373cb5eb6102681ff3fa40' 
  AND (
    token = 'sf2vARoVuFBC2KA+xBdYKUv5YytEv7XvCUUipmpXriI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027