UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1pu/Yf/3tNlVxxv8aLDO8awQOaxYPXAwEHp1r1vmwgY=' 
WHERE 
  key_id = '086d147d4d3697279507848f2dac67b52bb195a3c5c0b2726694f5786fa63f08' 
  AND (
    token = '1pu/Yf/3tNlVxxv8aLDO8awQOaxYPXAwEHp1r1vmwgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023