UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KCEynXe09/EowHTEC+JmR5lO/V87SXoj3S5mpr1/nZY=' 
WHERE 
  key_id = '20e36b7bf5f9034a28a91ed42da5d84260d144638da8ba9acc5b2eaae6ae549e' 
  AND (
    token = 'KCEynXe09/EowHTEC+JmR5lO/V87SXoj3S5mpr1/nZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034