UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7wWa4mT407SSeVDhBb1uISVjyi6kDRGzbSCwym022Lk=' 
WHERE 
  key_id = '0732349b7baa01be0fdef4c0997eca21f6c88fcd45e4c9ea180cd8275478c017' 
  AND (
    token = '7wWa4mT407SSeVDhBb1uISVjyi6kDRGzbSCwym022Lk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064