UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IKQ6irMRRjWt3bggJOerebOn4fChWHLCkY3e1SDQ4lI=' 
WHERE 
  key_id = '9958ee35fd212f1b653cbd28a86da89442367bc4f03b585ace075064fac805f0' 
  AND (
    token = 'IKQ6irMRRjWt3bggJOerebOn4fChWHLCkY3e1SDQ4lI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029