UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6zcpjipvFRuMFzmq4m63iwkGSQCIyiqsMsZOylVaO8E=' 
WHERE 
  key_id = 'f9b2169b3e45362a7d4cd32a3223fbc0a33ab7f0268eb2d655a2ee7dacb6fd16' 
  AND (
    token = '6zcpjipvFRuMFzmq4m63iwkGSQCIyiqsMsZOylVaO8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042