UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/pKPorQJqs38HcBN4heaZGf+Cg1DsfNuTYwrOukWaRM=' 
WHERE 
  key_id = 'e87efa27ea4cbda7432b6f65a08b1a7c87884ec99c3ee218892b769fc10e3367' 
  AND (
    token = '/pKPorQJqs38HcBN4heaZGf+Cg1DsfNuTYwrOukWaRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023