UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BgtIRMCH6dDCAVPBuZFs9ciTXePq2gyISWZdniXycKw=' 
WHERE 
  key_id = '8f708ef12a5e1cf6033a24362445f2b3d6ff182b5167ac8d59c45b380efc9d7e' 
  AND (
    token = 'BgtIRMCH6dDCAVPBuZFs9ciTXePq2gyISWZdniXycKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044